import java.util.ArrayList;


// list of all the players playing the game.
// we iterate over all player, each adding a shape one after the other
public class PLPlayers {
	ArrayList<PLPlayer> mPlayers;
	int mLast;

	
	public PLPlayers() {
		mLast = 0;		
		mPlayers = new ArrayList<PLPlayer>();		
	}

	public boolean AddPlayer(PLPlayer player) {
		mPlayers.add(player);
		return true;
	}

	public int NumPlayers() {return mPlayers.size();}

	public void BeginGet() { mLast = 0;}


	public PLPlayer GetNextPlayer() {
		if (mLast >= mPlayers.size() )
			return null;
		PLPlayer outPlayer = (PLPlayer) mPlayers.get(mLast);

		mLast++;

		return outPlayer;
	}

	public ArrayList<PLPlayer> GetAllPlayers() {return mPlayers;}

	public PLPlayer GetPlayerAt(int id) {return (PLPlayer)mPlayers.get(id);}

	public int GetLastPlayerIndex() {
		return mLast-1;
	}
}


